package chpt05;

import java.time.DayOfWeek;
import java.time.Month;
import java.time.format.TextStyle;
import java.util.Locale;

public class DayOfWeekMonthTest {

	public static void main(String[] args) {
		// 演示：DayOfWeek枚举常量
		DayOfWeek dof = DayOfWeek.SUNDAY;
		Locale locale = Locale.ENGLISH; // 获取英国区域
		String d = dof.getDisplayName(TextStyle.FULL, locale);
		String ds = dof.getDisplayName(TextStyle.SHORT, locale);
		int v = dof.getValue();
		System.out.println(v+" "+dof + " " + d + " " + ds);
		// 输出：7 SUNDAY Sunday Sun
		
		// 演示：Month枚举常量
		Month month = Month.NOVEMBER;
		locale = Locale.getDefault(); // 获取默认区域
		String m = month.getDisplayName(TextStyle.FULL, locale);
		System.out.println(month.getValue()+" " +month + " " + m);
		// 输出：11 NOVEMBER 十一月
		System.out.println(month.minus(10));
		// 输出：JANUARY

	}

}
